package com.masterlau.entry;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

/**
 * @author MasterLau
 */
final class Config implements Serializable {
    private static final long serialVersionUID = 1L;
    public String basisDir;
    public String javaHome;
    public String mavenHome;
    public String mavenExecutable;
    public String[] goals;
    public String[] profiles;
    public String mavenOpts;
    public List<Module> modules;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final Config config = (Config) o;
        return Objects.equals(basisDir, config.basisDir) && Objects.equals(javaHome, config.javaHome) && Objects.equals(mavenHome, config.mavenHome) && Objects.equals(mavenExecutable, config.mavenExecutable) && Arrays.equals(goals, config.goals) && Arrays.equals(profiles, config.profiles) && Objects.equals(mavenOpts, config.mavenOpts) && Objects.equals(modules, config.modules);
    }

    @Override
    public int hashCode() {
        int result = basisDir != null ? basisDir.hashCode() : 0;
        result = 31 * result + (javaHome != null ? javaHome.hashCode() : 0);
        result = 31 * result + (mavenHome != null ? mavenHome.hashCode() : 0);
        result = 31 * result + (mavenExecutable != null ? mavenExecutable.hashCode() : 0);
        result = 31 * result + Arrays.hashCode(goals);
        result = 31 * result + Arrays.hashCode(profiles);
        result = 31 * result + (mavenOpts != null ? mavenOpts.hashCode() : 0);
        return 31 * result + (modules != null ? modules.hashCode() : 0);
    }
}
